

package cn.shengchao.controler;

import cn.dev33.satoken.annotation.SaIgnore;
import cn.shengchao.examstar.product.ohs.local.appservice.ProductAppService;
import cn.shengchao.examstar.product.ohs.local.message.ProductDto;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Tag(name = "会员购买")
@Slf4j
@RestController
@CrossOrigin("${project.cross-origin}")
@RequestMapping("/api/${project.version}/productMember")
public class ProductMemberController {

    @Autowired
    private ProductAppService productAppService;

    @SaIgnore
    @GetMapping("{productMemberId}")
    @Operation(summary = "获取会员产品", description = "获取会员产品")
    public ProductDto getProductMember(@PathVariable Long productMemberId) {
        return productAppService.getProductById(String.valueOf(productMemberId));
    }

}
